package com.hc.homestay.pojo;

import java.util.ArrayList;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/***
 * 配置swagger
 * 
 * @author Juan hsj
 *
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {

	// 配置docket以配置Swagger具体参数
	@Bean
	public Docket docket() {

		return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo());
	}

	public ApiInfo apiInfo() {
		Contact contact = new Contact("hsj", "localhost:8080", "2402169448@qq.com");
		return new ApiInfo("hsj", "Spring Boot 测试使用 Swagger2 构建RESTful API", "1.0", "localhost:8080", contact, "1.0",
				"wangjiansuoyou", new ArrayList<>());
	}
}
